package com.lind.kickoffki.android;

import android.graphics.PointF;
import android.util.FloatMath;

import com.lind.kickoff.logic.IPoint;

public class AndroidPoint extends PointF implements IPoint {

	public AndroidPoint(double x, double y) {
		super((float)x,(float)y);
	}

	@Override
	public IPoint deepCopy() {
		return new AndroidPoint(getX(), getY());
	}

	@Override
	public double distance(IPoint p) {
		return  FloatMath.sqrt ((getY()-getX()) * (getY() - getX()) + (p.getY() - p.getX()) * (p.getY() - p.getX()));
	}

	public boolean equals(IPoint point) {
		return x == point.getX() && y == point.getY();
	}

	@Override
	public float getX() {
		return x;
	}

	@Override
	public float getY() {
		return y;
	}

	@Override
	public void setX(float x) {
		this.x = x;
	}

	@Override
	public void setY(float y) {
		this.y = y;
	}
}